package com.zj.transactionspringboot01.springboot;

import com.zj.pojo.Fruit;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration //去掉此注解，无法成为bean则下面的componentscan不会生效。
@ComponentScan(basePackages = "com.zj.transactionspringboot01.component")
public class Myconfig {

    @Bean
    Fruit fruit(){
        return new Fruit();
    }
}
